﻿namespace Example.Creational
{
    using Example.Creational.FactoryMethod;

    using Xunit;

    /// <summary>
    /// Define an interface for creating an object, but let subclasses decide which class to instantiate.
    /// Factory Method lets a class defer instantiation to subclasses.
    /// </summary>
    public sealed class FactoryMethodFacts
    {
        [Fact]
        public void extract_ant_from_colony()
        {
            Assert.IsType<Ant>(new Colony().Extract());
        }

        [Fact]
        public void extract_bee_from_hive()
        {
            Assert.IsType<Bee>(new Hive().Extract());
        }
    }
}